public class Numbers {

    public static double avg(double[] array) {
        double sum = 0.0;
        int length = array.length;
        for (int i = 0; i < length; i++) {
            sum = array[i] + sum;
        }
        return (sum / length);
    }



    public static void main(String[] args) {

        for(int i = 0;  i < 50;  i++)  {
            // part 1
            //part 2

            if((i+1)%2 == 0)  {
                System.out.printf(" The number is multiple 2: %d\n", i + 1);
            }
            else if ((i+1)%3 == 0) {
                System.out.printf(" The number is multiple 3: %d\n", i + 1);
            }
            else
                System.out.printf("#%d\n", i + 1);
        }
        //part 3
        System.out.printf("%s\n", "-----------------------------------------------------------");

        int NUM = 35;
        double [] arrayNums = new double[NUM];

        for (int i = 0; i < NUM; i++) {
            arrayNums[i] = i + 1;
            System.out.printf("Array's elements %d value: %.2f\n", i + 1, arrayNums[i]);
        }

        System.out.printf("The average: %.2f", avg(arrayNums));

    }
}
